/**
 * create by young (young2f@outlook.com) on 2020/12/4
 */
'use strict';
const model = require('../base/modelBase');
const _ = require('lodash');
module.exports = app => {
  const mongoose = app.mongoose;
  const schema = mongoose.Schema;
  const connect = app.mongooseDB.get('pmcBus');
  const json = {
    table: { type: String, _type: 'string', title: '表', },
    tableCode: { type: String, _type: 'string', title: '表', },
    label: { type: String, _type: 'string', title: '表', },
    fileList: { type: Array, _type: 'string', title: '图片' },
  };
  const _model = _.cloneDeep(model);
  _.assign(_model, json);
  const _schema = new schema(
    _model,
    { timestamps: { createdAt: 'createdTs', updatedAt: 'updatedTs' } }
  );
  return connect.model('Pic', _schema);
};
